Last active
December 21, 2015 04:09
Revisions
-
suzaku revised this gist
Aug 16, 2013 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,14 +23,14 @@ In [41]: ls -lh t[1,2,3,4] -rwxrwxr-x 1 vagrant vagrant 4.1K Aug 16 11:38 t3* -rwxrwxr-x 1 vagrant vagrant 402K Aug 16 11:40 t4* In [92]: data = 'a'*(32*1024) In [93]: fd5 = os.open('t5', os.O_CREAT | os.O_DSYNC | os.O_WRONLY) In [94]: %timeit os.write(fd5, data) 1000 loops, best of 3: 825 us per loop In [95]: fd6 = os.open('t6', os.O_CREAT | os.O_SYNC | os.O_WRONLY) In [96]: %timeit os.write(fd6, data) 1000 loops, best of 3: 831 us per loop -
suzaku revised this gist
Aug 16, 2013 . 1 changed file with 13 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,4 +21,16 @@ In [41]: ls -lh t[1,2,3,4] -rwxrwxr-x 1 vagrant vagrant 4.1K Aug 16 11:32 t1* -rwxrwxr-x 1 vagrant vagrant 4.1K Aug 16 11:32 t2* -rwxrwxr-x 1 vagrant vagrant 4.1K Aug 16 11:38 t3* -rwxrwxr-x 1 vagrant vagrant 402K Aug 16 11:40 t4* In [86]: data = 'a'*1024 In [88]: fd5 = os.open('t5', os.O_CREAT | os.O_DSYNC | os.O_WRONLY) In [89]: %timeit os.write(fd5, data) 1000 loops, best of 3: 366 us per loop In [90]: fd6 = os.open('t6', os.O_CREAT | os.O_SYNC | os.O_WRONLY) In [91]: %timeit os.write(fd6, data) 1000 loops, best of 3: 746 us per loop -
suzaku revised this gist
Aug 16, 2013 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,9 @@ In [37]: %timeit os.write(fd3, 'a'); os.fsync(fd3) In [38]: fd4 = os.open('t4', os.O_CREAT | os.O_WRONLY) In [39]: %timeit os.write(fd4, 'a') 100000 loops, best of 3: 2.32 us per loop In [41]: ls -lh t[1,2,3,4] -rwxrwxr-x 1 vagrant vagrant 4.1K Aug 16 11:32 t1* -rwxrwxr-x 1 vagrant vagrant 4.1K Aug 16 11:32 t2* -rwxrwxr-x 1 vagrant vagrant 4.1K Aug 16 11:38 t3* -rwxrwxr-x 1 vagrant vagrant 402K Aug 16 11:40 t4* -
suzaku created this gist
Aug 16, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ In [19]: fd = os.open('t1', os.O_CREAT | os.O_DSYNC | os.O_WRONLY) In [20]: %timeit os.write(fd, 'a') 1000 loops, best of 3: 232 us per loop In [21]: fd2 = os.open('t2', os.O_CREAT | os.O_SYNC | os.O_WRONLY) In [22]: %timeit os.write(fd2, 'a') 1000 loops, best of 3: 737 us per loop In [36]: fd3 = os.open('t3', os.O_CREAT | os.O_WRONLY) In [37]: %timeit os.write(fd3, 'a'); os.fsync(fd3) 1000 loops, best of 3: 740 us per loop In [38]: fd4 = os.open('t4', os.O_CREAT | os.O_WRONLY) In [39]: %timeit os.write(fd4, 'a') 100000 loops, best of 3: 2.32 us per loop