Click here to Skip to main content
15,886,110 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: After 20 Years, I'm Still Left Guessing Pin
CodeWraith26-Dec-20 7:00
CodeWraith26-Dec-20 7:00 
GeneralRe: After 20 Years, I'm Still Left Guessing Pin
obermd28-Dec-20 3:42
obermd28-Dec-20 3:42 
GeneralRe: After 20 Years, I'm Still Left Guessing Pin
pkfox26-Dec-20 12:07
professionalpkfox26-Dec-20 12:07 
GeneralRe: After 20 Years, I'm Still Left Guessing Pin
Rick York26-Dec-20 17:04
mveRick York26-Dec-20 17:04 
GeneralRe: After 20 Years, I'm Still Left Guessing Pin
Shao Voon Wong26-Dec-20 23:29
mvaShao Voon Wong26-Dec-20 23:29 
GeneralRe: After 20 Years, I'm Still Left Guessing Pin
Greg Utas27-Dec-20 1:37
professionalGreg Utas27-Dec-20 1:37 
GeneralRe: After 20 Years, I'm Still Left Guessing Pin
#realJSOP27-Dec-20 1:42
mve#realJSOP27-Dec-20 1:42 
GeneralPerformance woes. I'm appalled. Pin
honey the codewitch26-Dec-20 4:46
mvahoney the codewitch26-Dec-20 4:46 
Read 1231388 nodes and 20383269 characters in 1069.479000 ms at 17.765660MB/s
Skipped 1231388 nodes and 20383269 characters in 534.699000 ms at 35.534011MB/s
utf8 scanned 20383269 characters in 377.561000 ms at 50.322994MB/s
raw ascii i/o 20383269 characters in 62.034000 ms at 306.283651MB/s
raw ascii block i/o 19 blocks in 49.023000 ms at 387.573180MB/s


The first line is full JSON parsing

The second line is JSON "skipping" - a minimal read where it doesn't normalize anything it just moves as fast as possible through the document.

The third line is ut8 reading through my input source class but without doing anything JSON related

The fourth line is calling fgetc() in a loop

The fifth line is falling fread() in a loop and then scanning over the characters in each block (so i'm not totally cheating by not examining characters)

The issue here is the difference between my third line and the fourth line (utf8 scan vs fgetc). The trouble is even when I removed the encoding it made no measurable difference in speed. Underneath everything both are using fgetc. Even when I changed mine to block read using fread() it didn't speed things up.

I'm at a loss. I'm not asking a question here, mostly just expressing frustration because i have not a clue how to optimize this.
Real programmers use butterflies

GeneralRe: Performance woes. I'm appalled. Pin
harold aptroot26-Dec-20 4:58
harold aptroot26-Dec-20 4:58 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch26-Dec-20 5:28
mvahoney the codewitch26-Dec-20 5:28 
GeneralRe: Performance woes. I'm appalled. Pin
Daniel Pfeffer26-Dec-20 7:08
professionalDaniel Pfeffer26-Dec-20 7:08 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch26-Dec-20 8:12
mvahoney the codewitch26-Dec-20 8:12 
GeneralRe: Performance woes. I'm appalled. Pin
trønderen26-Dec-20 9:01
trønderen26-Dec-20 9:01 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch26-Dec-20 10:19
mvahoney the codewitch26-Dec-20 10:19 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch26-Dec-20 16:57
mvahoney the codewitch26-Dec-20 16:57 
GeneralRe: Performance woes. I'm appalled. Pin
trønderen26-Dec-20 18:50
trønderen26-Dec-20 18:50 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 0:55
mvahoney the codewitch27-Dec-20 0:55 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 1:05
mvahoney the codewitch27-Dec-20 1:05 
GeneralRe: Performance woes. I'm appalled. Pin
Josh Gray228-Dec-20 1:47
Josh Gray228-Dec-20 1:47 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch28-Dec-20 2:02
mvahoney the codewitch28-Dec-20 2:02 
GeneralRe: Performance woes. I'm appalled. Pin
Jörgen Andersson27-Dec-20 3:45
professionalJörgen Andersson27-Dec-20 3:45 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 4:07
mvahoney the codewitch27-Dec-20 4:07 
GeneralRe: Performance woes. I'm appalled. Pin
Jörgen Andersson27-Dec-20 4:13
professionalJörgen Andersson27-Dec-20 4:13 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 4:31
mvahoney the codewitch27-Dec-20 4:31 
GeneralRe: Performance woes. I'm appalled. Pin
Jörgen Andersson27-Dec-20 4:51
professionalJörgen Andersson27-Dec-20 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.